function write2ascii(filename,trials,nTrials,precision)
%write channel in column
%nTrials=length(trials.trial);
if(length(trials.trial)>= nTrials)
    dlmwrite(filename, trials.trial{1}','delimiter','\t','precision',precision);%,'precision','%d'

    for i=2:nTrials
        dlmwrite(filename,trials.trial{i}','-append','delimiter','\t','precision',precision);
    end
else
    warning=strcat(filename,'--not enough trials')
end